require('./index.css');
require('page/common/top/index.js');
var _order_service = require('service/order-service.js')

var orderShipping = {
    init : function(){
        this.loadAccountInfo();
        this.bindEvents();
        return this;
    },
    bindEvents : function(){
        $('#newOrder').on('click',function(){
            var formData = {
                shipToFirstName : $('#shipToFirstName').val(),
                shipToLastName  : $('#shipToLastName').val(),
                shipAddress1    : $('#shipAddress1').val(),
                shipAddress2    : $('#shipAddress2').val(),
                shipCity        : $('#shipCity').val(),
                shipState       : $('#shipState').val(),
                shipZip         : $('#shipZip').val(),
                shipCountry     : $('#shipCountry').val()
            }
            _order_service.setShipOrder(formData,
                function(res){
                    window.location.href = './order-confirm.html'
                },
                function(errorMsg){

                }
                )
        })
    },
    loadAccountInfo : function(){
        
    }
};

module.exports = orderShipping.init()